<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
	function myAddEvent(obj,ev, fn)
	{
			if(obj.attachEvent)
			{
					obj.attachEvent('on' + ev,fn);
			}
			else
			{
					obj.addEventListener(ev,fn,false);
			}
	}
	
window.onload = function()
{
		var oBtn = document.getElementById('btn1');
		
	
				myAddEvent(oBtn,'click',function()
				{
					alert(9);	
				});
			
				myAddEvent(oBtn,'click',function()
				{
					alert(8);	
				});

	
};

</script>
</head>

<body>
<input type="button" id="btn1">
</body>
</html>
